<div id="content">

    <div id="content-header">

        <div id="breadcrumb"><a href="<?php echo site_url('Login/login') ?>" title="Go to Home" class="tip-bottom"><i
                class="icon-home"></i> 主页</a> <a href="#" class="current">财务管理</a></div>

        <h1>代理待结算返利列表</h1>

    </div>

    <div class="container-fluid">

        <hr>

        <div class="row-fluid">

            <div class="span12">
                <div class="widget-box">
                    <div class="widget-title"><span class="icon"><i class="icon-th"></i></span>
                        <h5>Data table</h5>
                    </div>
                    <div class="widget-content nopadding">
                        <table class="table table-bordered data-table">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>账号名称</th>
                                <th>代理等级</th>
                                <th>个人返利等级</th>
                                <th>个人返利利率</th>
                                <th>个人充值</th>
                                <th>直属下级代理充值</th>
                                <th>次级代理充值</th>
                                <th>业绩总额</th>
                                <th>业绩提成返利等级</th>
                                <th>业绩返利利率</th>
                                <th>核算返利额</th>
                                <th>下级代理业绩扣除</th>
                                <th>应发返利总额</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php
                            $rows=$data[0];
                            foreach($rows as $value):
                            ?>
                            <tr class="gradeX">
                                <td><?php  echo $value['id']?></td>
                                <td><?php  echo $value['nickname']?></td>
                                <td class="center"><?php  echo $value['lid']?></td>
                                <td class="center"><?php  echo $value['ad']?></td>
                                <td class="center"><?php  echo $value['rr']?></td>
                                <td class="center"><?php echo $value['totalFee']?></td>
                                <td class="center"><?php  echo $value['xtotalFee']?></td>
                                <td class="center"><?php  echo $value['xxtotalFee']?></td>
                                <td class="center"><?php  echo $value['totalFee']+$value['xtotalFee']+$value['xxtotalFee']?></td>
                                <td class="center"><?php  echo $value['adgp']?></td>
                                <td class="center"><?php  echo $value['rrgp']?></td>
                                <td class="center"><?php  echo $value['rrgp']*($value['totalFee']+$value['xtotalFee']+$value['xxtotalFee'])?></td>
                                <td class="center"><?php  echo $value['rrgp']*($value['xtotalFee']+$value['xxtotalFee'])?></td>
                                <td class="center"><?php  echo $value['rrgp']*($value['totalFee'])?></td>
                                <?php
                        $id=intval($value['id']);
                       $url=site_url("finance/interestBackById/$id/0");
                        $url1=site_url("finance/doInterestBackById/$id");

?>
                                <td class="center">
                                    <button class="btn btn-warning btn-mini"
                                            onClick="window.open('<?php echo $url;?>','_self')">查看详细
                                    </button>
                                    <button class="btn btn-primary btn-mini"
                                            onClick="window.open('<?php echo $url1;?>','_self')">生成结算订单
                                    </button>
                                </td>
                            </tr>
                            <?php    endforeach; ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

        </div>

    </div>

</div>